//
//  UIDevice+TYSystemInfo.m
//  TYUIKit
//
//  Created by TuyaInc on 2018/12/20.
//

#import "UIDevice+TYSystemInfo.h"

NSString * const kTYSystemName_iOS = @"iOS";

inline CGFloat TY_SystemVersion(void) {
    return [[[UIDevice currentDevice] systemVersion] floatValue];
}

inline NSString * TY_SystemName(void) {
    return [[UIDevice currentDevice] systemName];
}

inline BOOL TY_IsIOS(CGFloat v) {
    return [TY_SystemName() isEqualToString:kTYSystemName_iOS] && TY_SystemVersion() >= v;
}

inline BOOL TY_IsPad(void) {
//    BOOL isPadSupport = [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"TY_PadSupport"] boolValue];
    return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
}
